<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
	<TITLE></TITLE>
	<META NAME="GENERATOR" CONTENT="OpenOffice.org 2.0  (Linux)">
	<META NAME="AUTHOR" CONTENT="kejin">
	<META NAME="CREATED" CONTENT="20061120;17150100">
	<META NAME="CHANGEDBY" CONTENT="kejin">
	<META NAME="CHANGED" CONTENT="20070513;11584200">
	<STYLE TYPE="text/css">
	<!--
		@page { size: 8.5in 11in; margin: 0.79in }
		P { margin-bottom: 0.08in }
		H2 { color: #000000 }
		H3 { color: #000000 }
		PRE { color: #000000 }
	-->
	</STYLE>
</HEAD>
<BODY LANG="en-US" DIR="LTR">
<H2>PocoCapsule/C++example: CORBA JTRS SCA 
</H2>
<P>Copyright(c) 2006 by <A HREF="http://www.pocomatic.com/">Pocomatic
Software</A>. All rights reserved. 
</P>
<P>The Software Communications Architecture (<A HREF="http://jtrs.spawar.navy.mil/sca">SCA</A>)
is a component model for Software Defined Radio (SDR) applications
defined by US Navy Joint Tactical Radio System (<A HREF="http://jtrs.spawar.navy.mil/">JTRS</A>).
The <A HREF="http://jtrs.spawar.navy.mil/sca/">JTRS-SCA</A> is based
on OMG CORBA, and is effectively a CCM non-compliant poorman's
version of lightweight CORBA component model. 
</P>
<P>Existing <A HREF="http://jtrs.spawar.navy.mil/sca/">JTRS-SCA</A>
containers, such as the <A HREF="http://www.crc.ca/scari/">SCA
reference implementation from CRC</A> (Java) and the <A HREF="http://ossie.mprg.org/">OSSIE
from MPRG</A> (C++), are all built as heavily engineered heavyweight
ad-hoc solutions. This example shows that, using Pococapsule/C++, a
<A HREF="http://jtrs.spawar.navy.mil/sca/">JTRS-SCA</A> container can
easily be implemented, with minimum coding effort, as a simple
domain-specific component model that can be transparently transformed
into the PocoCapsule/C++'s core deployment model, using
transformation templates or stylesheet file <A HREF="jtrs-sca-lite2poco.xsl">jtrs-sca-lite2poco.xsl</A>.</P>
<P>This SDR waveform application example in form of <A HREF="http://jtrs.spawar.navy.mil/sca/">JTRS-SCA</A>
is originated from the <A HREF="http://www.crc.ca/scari/">SCA
reference implementation of CRC</A>. 
</P>
<P><I>Note: PocoCapsule also supports and presents a non-CORBA
version of this same SDR waveform application, that can be found in
the <A HREF="../../basic-ioc/sdr/README.html">${POCOCAPSULE_DIR}/examples/basic-ioc/sdr</A>
directory. That non-CORBA version of this SDR waveform application is
more straightforward and significantly slim than the CORBA version
presented here. Therefore, if components of a waveform application
are not distributed across multiple nodes, then, the simple POCO
approach without CORBA would be a much better alternative.</I></P>
<P>The modeled SCA waveform application in this example consists of
the following eight components (see <A HREF="srv.xml">srv.xml</A>):</P>
<UL>
	<LI><P><FONT SIZE=2>An AudioDevice: the node1-audio-device CORBA
	object, that has three &quot;uses&quot; ports and three &quot;provides&quot;
	ports. </FONT>
	</P>
	<LI><P><FONT SIZE=2>An AudioEchoResource: the echo-resource CORBA
	object, that has two &quot;uses&quot; ports and one &quot;provides&quot;
	port.</FONT></P>
	<LI><P><FONT SIZE=2>An AudioChorusResource: the chorus-resource
	CORBA object, that has two &quot;uses&quot; ports and one &quot;provides&quot;
	port.</FONT></P>
	<LI><P><FONT SIZE=2>An AudioEffectController: the
	audio-effect-controller CORBA object, that has five &quot;uses&quot;
	ports.</FONT></P>
	<LI><P><FONT SIZE=2>A ModulationFMResource: the
	modulation-FM-resource CORBA object, that has two &quot;uses&quot;
	ports and one &quot;provides&quot; port.</FONT></P>
	<LI><P><FONT SIZE=2>A DemodulationFMResource: the
	demodulation-FM-resource CORBA object, that has two &quot;uses&quot;
	ports and one &quot;provide&quot; port.</FONT></P>
	<LI><P><FONT SIZE=2>A FMTransmitterReceiverAssemblyController: the
	FM-transmitter-receiver-assembly-controller CORBA object, that has
	five &quot;uses&quot; ports.</FONT></P>
	<LI><P><FONT SIZE=2>A LogImpl: the log-service CORBA object.</FONT></P>
</UL>
<P>These components are implemented as CORBA objects (therefore, they
can be distributed across different addressing spaces) that export
themselves through an external OMG naming service. For simplicity and
to focus on showing component wiring, the naming service is mocked
using a internal map in this example (see bind_ns() in <A HREF="scahelper.C">scahelper.C</A>).
<A HREF="http://jtrs.spawar.navy.mil/sca/">JTRS-SCA</A> components
(objects) and their ports listed above are instantiated, activated,
and binded to this naming service by the Pococapsule container, as
described in the PocoCapsule CORBA application descriptor <A HREF="srv.xml">srv.xml</A>.
And then, they are wired up by Pococapsule following the description
of a <A HREF="http://jtrs.spawar.navy.mil/sca/">JTRS-SCA</A><FONT COLOR="#944794">
</FONT><I><FONT COLOR="#000000">assembly descriptor</FONT></I>
<A HREF="sad.xml">sad.xml</A>. The assembled <A HREF="http://jtrs.spawar.navy.mil/sca/">JTRS-SCA</A>
waveform application is illustrated in the following diagram: 
</P>
<H3><A HREF="sdr.jpg"><IMG SRC="sdr.jpg" NAME="SDR.JPG" ALIGN=LEFT WIDTH=558 HEIGHT=417 BORDER=0><BR CLEAR=LEFT></A>Source
Files</H3>
<P><A HREF="main.C">main.C:</A> This is a mini container used to
setup and assemble the example SCA waveform application. It is
notable that this container itself neither contains code, nor links
with application specific bean implementations.</P>
<P><A HREF="CF.idl">CF.idl</A>: This is a mini mocked version of
<A HREF="http://jtrs.spawar.navy.mil/sca/">JTRS-SCA</A> core
framework (CF) IDL module definition. It only includes those CF
interfaces (e.g. CF::Resource and CF::Port, etc.) and methods that
are needed by this example. Also, for demonstration purpose, a common
Base interface with an attribute &quot;name&quot; is added to all
interfaces.</P>
<P><A HREF="sample.idl">simple.idl</A>: This IDL module defines
mocked push port component interfaces. 
</P>
<P><A HREF="sampleImpl.h">simpleImpl.h</A> and <A HREF="sampleImpl.C">sampleImpl.C</A>:
These files provide mocked implementations of the CF::Resource and
push port. 
</P>
<P><A HREF="scahelper.h">scahelper.h</A> and <A HREF="scahelper.C">scahelper.C</A>:
These files implemented helper methods that are used by PocoCapsule
container in assembling a SCA application. 
</P>
<P><A HREF="jtrs-sca-lite.dtd">jtrs-sca-lite.dtd</A>: The XML
document type definition of <A HREF="http://jtrs.spawar.navy.mil/sca/">JTRS-SCA</A>
assembly descriptor.</P>
<P><A HREF="jtrs-sca-lite2poco.xsl">jtrs-sca-lite2poco.xsl</A>: The
XSLT stylesheet that specifies the transformation from the <A HREF="http://jtrs.spawar.navy.mil/sca/">JTRS-SCA</A>
assembly descriptor to the POCO IoC application descriptor.</P>
<P><A HREF="srv.xml">srv.xml</A>: A Pococapsule CORBA application
descriptor that describes this example's CORBA objects (components
and ports) setup.</P>
<P><A HREF="sad.xml">sad.xml</A>: A <A HREF="http://jtrs.spawar.navy.mil/sca/">JTRS-SCA</A>
assembly descriptor that describes the wiring (connections) of
components/ports in the <A HREF="http://jtrs.spawar.navy.mil/sca/">JTRS-SCA</A>
waveform application.</P>
<P><A HREF="setup.xml">setup.xml</A>: The root descriptor that loads
all needed libraries and then instantiates and wires (connects) the
<A HREF="http://jtrs.spawar.navy.mil/sca/">JTRS-SCA</A> waveform
application by importing their descriptor from srv.xml and sad.xml. 
</P>
<H3>Building this example</H3>
<P STYLE="font-weight: medium">To build this example, the environment
variable POCOCAPSULE_DIR should point to the PocoCapsule/C++
installed directory. Also, this example assumes an underneath ORB
(e.g. VisiBroker/C++, TAO, etc.) is installed and its runtime and
development environment (such as POCOCAPSULE_DIR, VBROKER_DIR or
TAO_ROOT, etc. env variable) are set according to its product
specification. Then, this example can be built by simply invoking
gmake/make on linux/unix or nmake on windows. 
</P>
<H3>Running this example</H3>
<P><FONT FACE="Symbol">&middot; </FONT><FONT FACE="Times New Roman">Before
starting <FONT FACE="Times New Roman">the application deployment
container (i.e. the main executable)</FONT>, make sure the
LD_LIBRARY_PATH (on linux and solaris) or the PATH (on windows)
environment variable is set correctly to include the
${POCOCAPSULE_DIR}/lib directory and the ${VBROKREDIR}/lib (if
VisiBroker is used) or the ${TAO_ROOT}/lib directory (if TAO is
used).</FONT></P>
<P><FONT FACE="Symbol">&middot; </FONT><FONT FACE="Times New Roman">run
this example by executing the main executable: </FONT>
</P>
<PRE STYLE="margin-left: 0.79in; margin-bottom: 0.2in"><FONT FACE="Courier 10 Pitch"><FONT SIZE=2 STYLE="font-size: 11pt"><B>prompt&gt;</B> main </FONT></FONT></PRE><P STYLE="margin-bottom: 0in">
<FONT FACE="Times New Roman">It will display following connection
wirings assembled by the container:</FONT></P>
<PRE><FONT FACE="Courier 10 Pitch"><FONT SIZE=1 STYLE="font-size: 8pt">[wire-00]: The AudioOut port of the node1 audio device is connected to the AudioIn port of the audio echo resource (connection-id: Node1AudioToEchoResource0)</FONT></FONT>
<FONT FACE="Courier 10 Pitch"><FONT SIZE=1 STYLE="font-size: 8pt">[wire-01]: The AudioOut port of the audio echo resource is connected to the AudioIn port of the audio chorus resource (connection-id: EchoResource0ToChorusResource0)</FONT></FONT>
<FONT FACE="Courier 10 Pitch"><FONT SIZE=1 STYLE="font-size: 8pt">[wire-02]: The AudioOut port of the audio chorus resource is connected to the AudioIn port of the node1 audio device (connection-id: ChorusResource0ToNode1Audio)</FONT></FONT>
<FONT FACE="Courier 10 Pitch"><FONT SIZE=1 STYLE="font-size: 8pt">[wire-03]: The AudioInControl port of the audio effect controller is connected to the node1 audio device (connection-id: InController0ToNode1AudioDevice)</FONT></FONT>
<FONT FACE="Courier 10 Pitch"><FONT SIZE=1 STYLE="font-size: 8pt">[wire-04]: The AudioOutControl port of the audio effect controller is connected to the node1 audio device (connection-id: OutController0ToNode1AudioDevice)</FONT></FONT>
<FONT FACE="Courier 10 Pitch"><FONT SIZE=1 STYLE="font-size: 8pt">[wire-05]: The LogPort port of the audio effect controller is connected to the log (connection-id: AudioEffectApplication0ToLog)</FONT></FONT>
<FONT FACE="Courier 10 Pitch"><FONT SIZE=1 STYLE="font-size: 8pt">[wire-06]: The LogPort port of the node1 audio device is connected to the log (connection-id: Node1AudioDevice0ToLog)</FONT></FONT>
<FONT FACE="Courier 10 Pitch"><FONT SIZE=1 STYLE="font-size: 8pt">[wire-07]: The LogPort port of the audio echo resource is connected to the log (connection-id: EchoResource0ToLog)</FONT></FONT>
<FONT FACE="Courier 10 Pitch"><FONT SIZE=1 STYLE="font-size: 8pt">[wire-08]: The LogPort port of the audio chorus resource is connected to the log (connection-id: ChorusResource0ToLog)</FONT></FONT>
<FONT FACE="Courier 10 Pitch"><FONT SIZE=1 STYLE="font-size: 8pt">[wire-09]: The AudioEchoControl port of the audio effect controller is connected to the audio echo resource (connection-id: AudioEffectController0ToEchoResource0)</FONT></FONT>
<FONT FACE="Courier 10 Pitch"><FONT SIZE=1 STYLE="font-size: 8pt">[wire-10]: The AudioChorusControl port of the audio effect controller is connected to the audio chorus resource (connection-id: AudioEffectController0ToChorusResource0)</FONT></FONT>
<FONT FACE="Courier 10 Pitch"><FONT SIZE=1 STYLE="font-size: 8pt">[wire-11]: The DoubleSeqOut port of the demodulation FM resource is connected to the AudioInRightDouble port of the node1 audio device (connection-id: DemodulationFMResourceTonode1AudioDevice)</FONT></FONT>
<FONT FACE="Courier 10 Pitch"><FONT SIZE=1 STYLE="font-size: 8pt">[wire-12]: The AudioOutLeftDouble port of the node1 audio device is connected to the DoubleSeqIn port of the demodulation FM resource (connection-id: node1AudioDeviceToDemodulationFMResource)</FONT></FONT>
<FONT FACE="Courier 10 Pitch"><FONT SIZE=1 STYLE="font-size: 8pt">[wire-13]: The LogPort port of the modulation FM resource is connected to the log (connection-id: ModulationFMTolog)</FONT></FONT>
<FONT FACE="Courier 10 Pitch"><FONT SIZE=1 STYLE="font-size: 8pt">[wire-14]: The LogPort port of the FM transmitter/receiver assembly controller is connected to the log (connection-id: FMTransmitterReceiverAssemblyControllerTolog)</FONT></FONT>
<FONT FACE="Courier 10 Pitch"><FONT SIZE=1 STYLE="font-size: 8pt">[wire-15]: The DoubleSeqOut port of the modulation FM resource is connected to the AudioInLeftDouble port of the node1 audio device (connection-id: ModulationFMTonode1AudioDevice)</FONT></FONT>
<FONT FACE="Courier 10 Pitch"><FONT SIZE=1 STYLE="font-size: 8pt">[wire-16]: The InputDeviceControl port of the FM transmitter/receiver assembly controller is connected to the node1 audio device (connection-id: FMTransmitterReceiverAssemblyControllerTonode1AudioDevice_1)</FONT></FONT>
<FONT FACE="Courier 10 Pitch"><FONT SIZE=1 STYLE="font-size: 8pt">[wire-17]: The ModulationFMControl port of the FM transmitter/receiver assembly controller is connected to the modulation FM resource (connection-id: FMTransmitterReceiverAssemblyControllerToModulationFM_49)</FONT></FONT>
<FONT FACE="Courier 10 Pitch"><FONT SIZE=1 STYLE="font-size: 8pt">[wire-18]: The LogPort port of the demodulation FM resource is connected to the log (connection-id: DemodulationFMResourceTolog)</FONT></FONT>
<FONT FACE="Courier 10 Pitch"><FONT SIZE=1 STYLE="font-size: 8pt">[wire-19]: The OutputDeviceControl port of the FM transmitter/receiver assembly controller is connected to the node1 audio device (connection-id: FMTransmitterReceiverAssemblyControllerTonode1AudioDevice_2)</FONT></FONT>
<FONT FACE="Courier 10 Pitch"><FONT SIZE=1 STYLE="font-size: 8pt">[wire-20]: The AudioOutLeftDouble port of the node1 audio device is connected to the DoubleSeqIn port of the modulation FM resource (connection-id: node1AudioDeviceToModulationFM)</FONT></FONT>
<FONT FACE="Courier 10 Pitch"><FONT SIZE=1 STYLE="font-size: 8pt">[wire-21]: The DemodulationFMControl port of the FM transmitter/receiver assembly controller is connected to the demodulation FM resource (connection-id: FMTransmitterReceiverAssemblyControllerToDemodulationFMResource)</FONT></FONT></PRE><P STYLE="margin-bottom: 0in; font-weight: medium">
<FONT FACE="Times New Roman"><FONT SIZE=3>It shows 22 SCA connections
are wired up.</FONT></FONT></P>
<P STYLE="margin-bottom: 0in; font-weight: medium"><FONT FACE="Times New Roman"><FONT SIZE=3><A HREF="../../README.html">Back
to the root page</A></FONT></FONT></P>
</BODY>
</HTML>
